package com.revai.engine.basic.controller;

import com.revai.engine.basic.service.BasicService;
import com.revai.engine.common.api.CommonResult;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.FileNotFoundException;
import javax.annotation.Resource;

import java.util.Map;

/**
 * Created by CodeGenerator on 2024/01/11.w
 */
@Api(tags = "BasicController", description = "获取项目基础配置接口")
@Controller
@RequestMapping("${server.api-path}/basic")
public class BasicController {
    @Resource
    private BasicService basicService;

    @ApiOperation(value = "获取项目配置")
    @RequestMapping(value = "/get_configs", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<Map<String, ?>> getConfig() throws FileNotFoundException {
        return CommonResult.success(basicService.getConfig());
    }
}
